package com.ysyc.driver_ee.adapter;

import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ysyc.driver_ee.R;
import com.ysyc.driver_ee.base.BaseAdapter;
import com.ysyc.driver_ee.model.DriverStatistical;
import com.ysyc.driver_ee.tools.StatusSettingUtils;

/**
 * <p>描述：(这里用一句话描述这个类的作用)</p>
 * 作者： Chan<br>
 * 日期： 2018/11/8 9:40<br>
 * 版本： v1.0<br>
 */
public class DriverStatisticsAdapter extends BaseAdapter<DriverStatistical>{


    public DriverStatisticsAdapter(Activity activity, int layoutView) {
        super(activity, layoutView);
    }

    @Override
    public void convert(MyViewHolder holder, DriverStatistical item) {
        View itemView = holder.itemView;
        ImageView iconView = itemView.findViewById(R.id.iv_icon_view);
        TextView nameTv = itemView.findViewById(R.id.tv_name_view);
        TextView identityTv = itemView.findViewById(R.id.tv_identity_tv);
        TextView todayTv = itemView.findViewById(R.id.tv_today_view);
        TextView accumulativeTv = itemView.findViewById(R.id.tv_accumulative_view);
        TextView singleQuantityTv = itemView.findViewById(R.id.tv_single_quantity_view);
        TextView accumulativeSingleQuantityTv = itemView.findViewById(R.id.tv_accumulative_single_quantity_view);
        StatusSettingUtils.setDriverAvatar(iconView, item.identity);
        nameTv.setText(item.driverName);
        StatusSettingUtils.setIdentity(identityTv, item.identity);
        todayTv.setText(item.todayWater+"");
        accumulativeTv.setText(item.totalWater+"");
        singleQuantityTv.setText(item.todayNum+"");
        accumulativeSingleQuantityTv.setText(item.totalNum+"");
    }
}
